Skip to content

build: migrate KMP Android DSL from androidLibrary {} to android {}#5734

Merged
jamesarich merged 1 commit into
mainfrom
migrate-kmp-android-dsl
Jun 3, 2026
Merged

build: migrate KMP Android DSL from androidLibrary {} to android {}#5734
jamesarich merged 1 commit into
mainfrom
migrate-kmp-android-dsl

Conversation

@jamesarich
Copy link
Copy Markdown
Collaborator

What

Renames the Kotlin Multiplatform Android DSL block from the deprecated androidLibrary { } to android { } across all 22 KMP library modules.

Why

On AGP 9.2.1 (our current version), android { } (inside kotlin { }) is the documented block for the com.android.kotlin.multiplatform.library plugin. androidLibrary { } is deprecated since AGP 9.1.0-alpha09 and slated for removal in a future release (expected AGP 10.0). Per the official Android-KMP plugin docs: "Starting with AGP 8.12.0, a new android{} block was introduced to replace androidLibrary{}."

Changes

  • androidLibrary {android { in 22 module build.gradle.kts files (core/*, feature/*)
  • Updated one stale comment in the convention plugin

The findByType<KotlinMultiplatformAndroidLibraryTarget>() calls in build-logic are unchanged — verified against the AGP 9.2.1 API jar that this type still backs the target and ...Target extends ...Extension, so the accessor rename doesn't affect target lookup.

Verification

  • ./gradlew help — all modules configure cleanly, no unresolved-reference or deprecation warnings
  • ./gradlew build --dry-run — full task graph wires up
  • ./gradlew spotlessApply spotlessCheck detekt assembleDebug test allTests — all pass (spotless introduced no changes)

Also audited the rest of the build for AGP 9 / Kotlin 2.3 deprecations (kotlinOptions, kapt, jcenter, legacy variant API, deprecated gradle.properties flags, manifest package=, etc.) — none found. Confirmed all module tests execute (no silently-skipped suites).

🤖 Generated with Claude Code

AGP 9.2.1 introduced `android {}` (in `kotlin {}`) to replace
`androidLibrary {}`, which is deprecated since AGP 9.1.0-alpha09 and
slated for removal. Rename the block across all 22 KMP library modules
and update the stale comment in the convention plugin.

The `findByType<KotlinMultiplatformAndroidLibraryTarget>()` calls in
build-logic are unchanged: that type still backs the target and
`...Target extends ...Extension` in the AGP 9.2.1 API.

Verified: ./gradlew help, build --dry-run, spotlessCheck, detekt,
assembleDebug, test, allTests all pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the build Build system changes label Jun 3, 2026
@jamesarich jamesarich enabled auto-merge June 3, 2026 19:41
@jamesarich jamesarich added this pull request to the merge queue Jun 3, 2026
@jamesarich jamesarich removed this pull request from the merge queue due to a manual request Jun 3, 2026
@jamesarich jamesarich merged commit ea872f3 into main Jun 3, 2026
18 checks passed
@jamesarich jamesarich deleted the migrate-kmp-android-dsl branch June 3, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build system changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant